package calbs.socket.enu;

/**
 * Created by zhangqin on 2017/8/7.
 */
public enum FrameReqEnum {
    DS_LOGIN("20","登录"),
    DS_FINISH("22","完成标志发送 终端=>服务器"),
    DS_ABLINE_UPLOAD("24","AB线上传"),
    DS_GETLINE("23","终端获取AB线"),
    DS_POS("27","上传轨迹数据"),
    DS_ALARMCODE("28","警报故障"),
    DS_UPDATE("29","升级请求"),
    CMD_NOP("00","空针")
    ;
    private String frameNumber;
    private String description;
    public String getFrameNumber() {
        return frameNumber;
    }

    public void setFrameNumber(String frameNumber) {
        this.frameNumber = frameNumber;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    FrameReqEnum(String frameNumber, String description) {
        this.frameNumber = frameNumber;
        this.description = description;
    }

    public static FrameReqEnum getFrameEnum(String frameNumber){
        for (FrameReqEnum frameReqEnum : FrameReqEnum.values()) {
            if(frameReqEnum.getFrameNumber().equals(frameNumber)){
                return frameReqEnum;
            }else{
                continue;
            }
        }
        return CMD_NOP;
    }
}
